﻿using System;
using DataAccessObject;
using EntityObject;
using SharedLibraries;
using SharedLibraries.Constants;
using ThangNM_LIB.FUNC;

namespace ThangNM
{
    public partial class Racing_Word : System.Web.UI.Page
    {
        public ThangNM.PublicInterface.Home_New mtpHome;

        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                hfAuto.Value = Security.MD5_Encrypt(OtherEx.getInfoRequest(1) + Folder_File.getFileNameByDateTime(ConstEx.Log_iType_NameFile_DateTime_C.Day, "") + "NmT@99!((@");
                mtpHome = Master as ThangNM.PublicInterface.Home_New;
                mtpHome.setClearMsg();
                if (!IsPostBack)
                    BindData();
            }
            catch (Exception ex)
            {
                if (mtpHome != null)
                    mtpHome.setNotifications(ConstEx.FunctionSetMsg.ERROR, ex.Message, e.ToString());
            }
        }

        protected void BindData()
        {
            CategoryEO _CategoryEO = (new CategoryDAO()).SelectBy_sQueryString_sUrl(null, System.IO.Path.GetFileName(Request.Url.LocalPath));
            Commons.setSEO_ON_PAGE(Page, _CategoryEO, this.GetType());
            Vote_Share_CommentUC1.BindData_NEW(_CategoryEO, true);
            lblsTitle.Text = _CategoryEO.sTitle;
            lblsTitle1.Text = _CategoryEO.sTitle;
            lblFK_iAccountID.Text = _CategoryEO.FK_sAccount;
            hplFK_iAccountID.NavigateUrl = OtherEx.AddDomainInUrl(FileNameByFunction.Tac_Gia_ + _CategoryEO.FK_sAccount + FileNameByFunction.HTML);
            lbliComment.Text = Convert.ToString(_CategoryEO.iComment);
            lbliVisit.Text = Convert.ToString(_CategoryEO.iVisit);
            lbliLike.Text = Convert.ToString(_CategoryEO.iLike);
            lbltDateTimeCreate.Text = _CategoryEO.tDateTimeCreate.ToString(FormatEx.Date_Time.Format_DateTime_WebView);
        }
    }
}